import {
  SKUKEY_ADD,
  SKUKEY_UPDATE,
  SKUKEY_GET,
  SKUKEY_DEL,
  SKUVALUE_DEL,
  SKU_ADD,
  SKU_UPDATE,
  SKU_GET,
  SKU_DEL,
} from './api';
import { METHOD, request } from '@/utils/request';
//获取规格属性
export async function getKeyValue(params) {
  return request(SKUKEY_GET, METHOD.GET, params);
}
//添加规格属性
export async function addKeyValue(params) {
  return request(SKUKEY_ADD, METHOD.POST, params);
}
//删除规格属性
export async function delKeyValue(params) {
  return request(SKUKEY_DEL, METHOD.DELETE, params);
}
//更新规格属性
export async function updateKeyValue(params) {
  return request(SKUKEY_UPDATE, METHOD.POST, params);
}
//删除规格属性值
export async function delValue(params) {
  return request(SKUVALUE_DEL, METHOD.DELETE, params);
}

//获取规格
export async function getSku(params) {
  return request(SKU_GET, METHOD.GET, params);
}
//添加规格属性
export async function addSku(params) {
  return request(SKU_ADD, METHOD.POST, params);
}
//删除规格属性
export async function delSku(params) {
  return request(SKU_DEL, METHOD.DELETE, params);
}
//更新规格属性
export async function updateSku(params) {
  return request(SKU_UPDATE, METHOD.PUT, params);
}

export default {
  getKeyValue,
  addKeyValue,
  updateKeyValue,
  delKeyValue,
  getSku,
  addSku,
  delSku,
  updateSku,
};
